package org.example.struct.array;

import java.util.ArrayList;
import java.util.List;

/**
 * @author liyishan
 * @date 2024/5/28 09:32
 * @apiNote
 */

public class Test02951FindPeaks {
    public List<Integer> findPeaks(int[] mountain) {
        int n = mountain.length;
        List<Integer> ans = new ArrayList<>();
        for(int i = 1; i< n-1 ;i++){
            if(mountain[i] > mountain[i-1] && mountain[i] > mountain[i+1]){
                ans.add(i);
            }
        }
        return ans;
    }
}
